package com.hyhy.hycloud.commons.exception;

import lombok.Getter;

/**
 * @author lanpengfei
 * @date 2018/9/12
 */
public abstract class HyCloudRuntimeException extends RuntimeException implements HyCloudErrorDescription {
    @Getter
    private String errorCode;

    public HyCloudRuntimeException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public HyCloudRuntimeException(String errorCode, Exception e) {
        super((e.getMessage() == null || "".equals(e.getMessage())) ? e.toString() : e.getMessage(), e);
        this.errorCode = errorCode;
    }
}
